//
//  Untitled.swift
//  PLDownload
//
//  Created by bin hu on 2025/7/7.
//

import Foundation

class ProtocolFactory {
    static func handler(for url: URL) -> ProtocolHandler {
        switch url.scheme {
        case "http", "https":
            return HTTPHandler()
        case "ftp":
            return FTPHandler()
        default:
            if url.pathExtension == "m3u8" {
                return M3U8Handler()
            }
            return HTTPHandler() // 默认
        }
    }
}
